export const delByIdAction = (id) => ({
  type: 'delById',
  payload: id,
});

export const updateByIdAction = (payload) => ({
  type: 'updateById',
  payload,
});

export const addAction = (task) => {
  const newItem = {
    task: task,
    id: Date.now(),
    isDone: false,
  };
  return {
    type: 'add',
    payload: newItem,
  };
};

export const updateTypeAction = (type) => ({
  type: 'updateType',
  payload: type,
});
